package com.elitel.frame.main.dao.ext;

import com.elitel.frame.main.entity.SysPrjservice;
import com.elitel.frame.main.entity.ext.PrjServiceExt;
import com.elitel.frame.main.entity.vo.PageRequestVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ExtSysPrjserviceMapper {

    List<SysPrjservice> getProjectServiceByPagination(PageRequestVo<SysPrjservice> pr);

    /**
     * @param pr
     * @return
     * @description 查询项目服务信息(Mysql)
     * @author guoyanfei
     * @date 2017/12/28
     */
    List<SysPrjservice> getProjectServiceByPaginationMysql(PageRequestVo<SysPrjservice> pr);

    List<SysPrjservice> getProjectServiceByPaginationPG(PageRequestVo<SysPrjservice> pr);

    List<SysPrjservice> getProjectServiceByPaginationSqlite(PageRequestVo<SysPrjservice> pr);

    Long getProjectServiceCount(PageRequestVo<SysPrjservice> pr);

    Long getProjectServiceCountSqlite(PageRequestVo<SysPrjservice> pr);

    void deleteProjectServiceConfig(List<String> list);

    List<SysPrjservice> getProjectServiceByPcode(String pcode);

    List<PrjServiceExt> getServerByPcode(String pcode);

    List<PrjServiceExt> getServiceBytype(@Param("pcode") String pcode, @Param("servertype") String servertype);

    /**
     * @param servicecode(服务code)
     * @return SysPrjservice实体
     * @Description 通过服务code查询服务项目关联表信息
     * @author guoyanfei
     * @date 2018/01/15
     */
    SysPrjservice getProjectServiceByServiceCode(String servicecode);

    /**
     * 根据状态查询数据
     *
     * @param sysPrjservice
     * @return
     */
    List<PrjServiceExt> getListByStatus(SysPrjservice sysPrjservice);

    List<SysPrjservice> getListByIds(SysPrjservice sysPrjservice);

    List<SysPrjservice> geServiceList(@Param("servicecodes") List<String> servicecodes, @Param("guids") List<String> guids);

    List<Map<String, Object>> selectCountGroupByType();

    /**
     * 获取最早时间
     *
     * @return
     */
    Date selectMinDate();

    int delByGuids(@Param("list") List<String> list);

    List<SysPrjservice> selectByGuIds(List<String> guidList);

    int updateServer(SysPrjservice sysPrjservice);

    List<PrjServiceExt> getList();

    List<String> getFSql();


    List<Map<String, Object>> getApp(@Param("guid1") String guid1);

    List<DbSearchMap> pagePrjServiceData(
            @Param("groupId") String groupId,
            @Param("servicetype") String servicetype,
            @Param("dataType") String dataType,
            @Param("servName") String servName,
            @Param("dbK") String dbK,
            @Param("app") String app,
            @Param("sim") String sim,
            @Param("order") String order,
            @Param("tbName") String tbName,
            @Param("status") Integer status);

    List<Map<String, Object>> getCounts(
            @Param("groupId") String groupId,
            @Param("servName") String servName,
            @Param("dbK") String dbK,
            @Param("servicetype") String servicetype,
            @Param("dataType") String dataType,
            @Param("sim") String sim,
            @Param("app") String app,
            @Param("tbName") String tbName,
            @Param("status") Integer status
    );


    int delGroupRelByServerIds(@Param("list") List<String> list);

    List<RTree> getAll2();

    List<RTree> getDB2();

    List<RTree> getByType2(@Param("sType") String sType);


}
